<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>圣杯布局</title>
</head>

<style>
body {
  margin: 0;
}

/* 写了两遍的padding或margin,width就会自适应 */
.container {
  padding-left: 200px;
  padding-right: 400px;

  height: 100vh;
}

.middle {
  float: left;

  height: 100%;
  width: 100%;
  background-color: darkgray;
}

.left {
  float: left;
  margin-left: -100%;

  position: relative;
  left: -200px;

  width: 200px;
  height: 100%;
  background-color: darkgreen;
}

.right {
  float: left;
  margin-left: -400px;

  position: relative;
  right:-400px;

  width: 400px;
  height: 100%;
  background-color: darkgoldenrod;
}

</style>

<body>
  <div class="container">
    <div class="middle"></div>
    <div class="left"></div>
    <div class="right"></div>
  </div>
  
</body>
</html>